% !TEX root = main.tex

\section{Adopt TouchRAM Metamodel into GeKo}
\label{sec:adopt_ram}

GeKo is a generic model weaver for any kind of models which metamodels are in consistence with \emph{ECore}.
Therefore users should define or import a metamodel for the specific kind of models that they are going to handle,
and make GeKo to adopt it.
For instance, if you want to model aspects and perform further model weaving via Petri net, you should define a
Petri net metamodel and import it into GeKo, so that GeKo is able to ``recognize'' this kind of models.

This section explains how to adopt the metamodel of RAM (Reusable Aspect Models) into GeKo, which
is originally used by the specific model weaver TouchRAM. We illustrates the metamodel-importing
and further necessary configuring, modeling, model weaving in detailed steps by a simple case study.
This is a manual to the fresh GeKo users.

\subsection{Get TouchRAM Metamodel}
You can find all necessary information about TouchRAM at the developer wiki page:
\url{http://trac.cs.mcgill.ca/RAM/}. Go to ``Getting Started'' page, you can find the SVN repository address
of TouchRAM package:\\ \url{svn+ssh://svn.cs.mcgill.ca/xtra/softeng/RAM/tool/}.

As discussed above, GeKo is able to adapt the metamodels in according to ECore.
Therefore we do not care the implementation of this specific model weaver (the entire TouchRAM package will consume
more than 1.5GB disk capacity), but the metamodel they are using for modeling. 
\emph{So the only thing you have to checkout is the ``model'' folder in the project ``ca.mcgill.sel.ram'' in the above SVN repository.}

\subsection{Import the TouchRAM Metamodel into GeKo}
\label{sec:import_ram}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.7\textwidth]{figure/import_ram/create_project}
	\caption{Create a new empty EMF project for the metamodel later to be imported}
	\label{fig:create_project}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.7\textwidth]{figure/import_ram/import_metamodels}
	\caption{Import TouchRAM metamodel into the EMF project newly created}
	\label{fig:import_metamodels}
\end{figure}

After checking-out the metamodel of TouchRAM, you have to create a new \emph{Empty EMF Project} and import this metamodel into this project.
We recommend you to store your user-defined projects for case studies in the \emph{examples}
folder in GeKo package, shown in \fig \ref{fig:GeKo_package}. This is not a must, but can help better
organize new projects needed for the experiment.

We create a new empty EMF project ``lu.uni.geko.examples.ram'' and indicate the location
under a sub-directory ``ram'' of the \emph{examples} folder, see \fig \ref{fig:create_project}.
Then we import the TouchRAM metamodel into this project, see \fig \ref{fig:import_metamodels}.

You can find the TouchRAM metamodel in Appendix \ref{sec:ram_metamodel}.
\fig \ref{fig:ram} shows the ECore diagram of the metamodel of RAM (Reusable Aspect Models). It defines an \emph{Aspect} consisting of
a \emph{StructuralView}, possible \emph{MessageView}, \emph{Instantiation} and \emph{Layout}.
Detailed \emph{StructuralView} metamodel is shown in \fig \ref{fig:structuralview}, and the included \emph{StateView} is shown in \fig \ref{fig:stateview}.
Detailed \emph{MessageView} metamodel is shown in \fig \ref{fig:messageview}. Finally the \emph{Types} used for future models is defined in \fig \ref{fig:types}.
The meaning of the main elements of the TouchRAM metamodel is explained below:
\begin{itemize}
	\item \textbf{Aspect}: The root of the defined entity \emph{RAM} (Reusable Aspect Models).
	\item \textbf{Layout}: The module contains coordinates of components of this aspect which should be displayed
		in the GUI of TouchRAM.
	\item \textbf{Instantiation}: The instantiation mapping between elements in two different aspects.
	\item \textbf{StructuralView}: Metamodel of UML class diagrams for this aspect.
	\item \textbf{AbstractMessageView}: Metamodel of  UML sequence diagrams for class operations of this aspect.
	\item \textbf{StateView}: Metamodel of UML state diagrams for classes in the \emph{StructuralView} (class diagram).
\end{itemize}
More details about RAM can be found in \cite{Kienzle:2010:ADR:1980562.1980570}.

\subsection{Some Necessary Manual Configurations}
As we mentioned in \sect \ref{sec:geko}, there are some configuration errors in the manifest file of project \emph{lu.uni.geko.joinpointdetection.drools}. 
These errors are caused by some inappropriate configurations of other case studies/experiments.
When you imported the intended metamodel of a specific kind of models, you need to re-configure GeKo to adopt this metamodel
for future modeling and weaving functionality.

Here are the manual steps to re-configure GeKo, including auto-generation of source code of eclipse editors for modeling according to such metamodel.
Currently it is a little bit complicated for the manual re-configuration. Again we are terribly sorry for the inconvenience now,
and trying to solve this problem in future GeKo versions.

\begin{figure}[t]
	\centering
	\includegraphics[width=0.8\textwidth]{figure/configuration/create_bs_pc_av}
	\caption{Generate EMF source code for base, pointcut and advice editors}
	\label{fig:create_bs_pc_av}
\end{figure}

\begin{figure}[t]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/configuration/register_bundle}
	\caption{Re-configure the manifest file of lu.uni.geko.joinpointdetection.drools project}
	\label{fig:register_bundle}
\end{figure}

\subsubsection{Start a new eclipse application.}
Select the main project, \emph{lu.uni.geko}, of GeKo and run it as a new Eclipse Application, see \fig \ref{fig:run_eclipse}.
The new eclipse application would enable all GeKo core features, see \fig \ref{fig:start_geko}.

\subsubsection{Import the EMF project.}
When the new eclipse application started, you need to import the EMF project which contains the TouchRAM metamodel into this new eclipse instance.
When importing the project opened in the original eclipse workbench, \emph{you should import the project at the original location
WITHOUT copying it into the new workspace of the newly started eclipse instance.}

\subsubsection{Generate GeKo base, pointcut and advice Editors.}
When imported the EMF project into the new eclipse workbench, select the main ECore file of the metamodel and choose
``Generate Base, Pointcut and Advice Editors'' function under the sub-menu ``GeKo Weaver'' of the pop-up menu.
In our case study, since the metamodel is divided into several sub-modules, we select the main ECore file \emph{RAM.ecore}
which contains the root entity \emph{Aspect} that incorporates remaining sub-module ECore models, see \fig \ref{fig:create_bs_pc_av}.

\subsubsection{Re-configure manifest file.}
When you perform generating the editors for base, pointcut and advice, the auto-generated projects are already automatically
included and opened in the new eclipse environment. However, we MUST import them back in the original eclipse
environment and then re-configure the manifest file in the project \emph{lu.uni.geko.joinpointdetection.drools} to correct
all remaining errors.

Therefore, firstly quit the newly started eclipse application and then import all auto-generated projects into the workbench
of the original eclipse environment. Again, be careful that do NOT import these projects with copying them into current workspace. 
You may notice that there are some exceptions in the console window of the original eclipse environment during generation
of the editors for base, pointcut and advice. Each exception starts with the following similar information:
\begin{quote}
\small
Could not install and start the plug-in `lu.uni.geko.examples.ram\_av.edit'!
Make sure that you started GeKo with the program argument '-dev bin'!
\end{quote}
These exceptions are caused because the auto-generated components cannot be properly registered in the newly started eclipse instance.
\emph{Please ignore these exceptions.} When you restart a new eclipse application after importing all the auto-generated projects into your
original eclipse environment, these exceptions will disappear.
Now open the manifest file in project \emph{joinpointdetection.drools} and manually re-configure it as follows:
\begin{enumerate}
	\item Delete all the unnecessary bundles in the \emph{Require-Bundle} section, \ie other model projects starting with the
		prefix of ``lu.uni.geko.examples''. Meanwhile delete all the unused packages of these unnecessary bundles in the
		\emph{Import-Package} section.
	\item Add all auto-generated model projects, \eg \emph{lu.uni.geko.examples.ram.model}, \etc, to the \emph{Require-Bundle} section.
	\item Add all Java packages of each auto-generated model project, \eg packages \emph{ram, ram.impl and ram.util} for
		in project \emph{lu.uni.geko.examples.ram.model}, \etc, to the \emph{Import-Package} section.
\end{enumerate} 
Our re-configuration result of this case study is depicted in \fig \ref{fig:register_bundle}.
When you finish the re-configuration, of course, refresh the project to remove all error information.

\subsection{Modeling and Weaving: A Simple Running Example}
Up to now, we completed all required preparation and re-configuration tasks for adopting TouchRAM metamodel into GeKo.
So, if fortunately enough, we are able to create \emph{base}, \emph{pointcut} and \emph{advice} models in GeKo in accordance with the TouchRAM metamodel
and perform model weaving that implementing the core functionality of TouchRAM.
We try it through a simple running example in the following steps.

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/casestudy_project}
	\caption{Create a case study project with consistent naming and locating principle}
	\label{fig:casestudy_project}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/new_wizard}
	\caption{New model creation options for TouchRAM metamodel}
	\label{fig:new_wizard}
\end{figure}



\subsubsection{Restart a new eclipse application with GeKo features.}
Simply run a new eclipse application through the main GeKo project \emph{lu.uni.geko}.

\subsubsection{Create a new General Project for experiment.}
As shown in \fig \ref{fig:casestudy_project}, we created a new empty \emph{General Project} for future case studies,
with the consistent \emph{naming} and \emph{locating} principle discussed before.

\subsubsection{Construct a base model.}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/base_root}
	\caption{Choose ``Aspect'' for model object as the ``Root'' of the base model}
	\label{fig:base_root}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{figure/simple_casestudy/modeling}
	\caption{Modeling Interface}
	\label{fig:modeling}
\end{figure}

In the case study project, we create an independent folder for each case study, \eg folder \emph{casestudy1} for this simple running example.

Now we are going to create the \emph{base} model. 
Right click the case study folder, choose ``New''$\rightarrow$``Other'' and then go to ``Example EMF Model Creation Wizards'',
you will find some new model options added, see \fig \ref{fig:new_wizard}:
\begin{itemize}
	\item \textbf{Ram Model}: To create a \emph{base} model in consistence with the TouchRAM metamodel.
	\item \textbf{Ram\_pc Model}: To create a \emph{pointcut} model in consistence with the \emph{manipulated} TouchRAM metamodel.
	\item \textbf{Ram\_av Model}: To create an \emph{advice} model in consistence with the \emph{manipulated} TouchRAM metamodel.
	\item \textbf{Pc2AvMapping Model}: To create a user-defined \emph{mapping} model from the elements of the \emph{pointcut} model to 
		the corresponding elements of the \emph{advice} model.
\end{itemize}
You can create intended model by selecting target wizard option, so we are not going to repeat the model creation process hereinafter.
Regarding the manipulated TouchRAM metamodel, we are going to explain it in details later in \sect \ref{sec:manipulated_metamodels}.

To create a \emph{base} model, we choose ``Ram Model'' wizard option. Click ``Next'' and then you can rename the base model.
\emph{Please KEEP the extension file name ``.ram'' to make sure the GeKo can recognize this model as base model later
in model weaving process.} Similarly when you create other necessary models, \eg \emph{pointcut} and \emph{advice}, please also keep their
extension file names in default. We will not warn this in the remaining context of this technical report.

After renaming the \emph{base} model, click ``Next'' and then GeKo asks for a ``Model Object'', see \fig \ref{fig:base_root}.
The \emph{Model Object} means the ``Root'' entity of this model.
From \fig \ref{fig:base_root}, you will find that the drop-list provides all instantiable entities of the metamodel of TouchRAM
(non-abstract entities). As we explained in \sect \ref{sec:import_ram}, the TouchRAM uses \emph{aspects} as modeling
and weaving units. So the entity \emph{Aspect} in the TouchRAM metamodel, see \fig \ref{fig:ram}, is the root entity.
Therefore, we choose ``Aspect'' as \emph{Model Object} for \emph{base} model, shown in \fig \ref{fig:base_root}, and click ``Finish''.

When a new empty base model created, you can perform modeling by right-clicking a specific model element and choosing
``New Child'' or ``New Sibling'' to add new element in appropriate position, \ie new element is a child or a sibling of current element
in consistence with the metamodel. You can also edit attributes of a selected model element in the eclipse \emph{Properties} view window.
Figure \ref{fig:modeling} shows what the user modeling interface looks like.

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.3\textwidth]{figure/simple_casestudy/casestudy1_base}
	\caption{UML class diagram of the base model}
	\label{fig:casestudy1_base}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.8\textwidth]{figure/simple_casestudy/inheritance}
	\caption{Inheritance modeling}
	\label{fig:inheritance}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{figure/simple_casestudy/casestudy1_base_result}
	\caption{Final base model in GeKo interface}
	\label{fig:casestudy1_base_result}
\end{figure}


Now we start our experiment from a very simple running example. As shown in \fig \ref{fig:casestudy1_base}, the \emph{base} model contains only
a class diagram (StructuralView) with two classes: class \emph{B} inherits an abstract class \emph{A}.
The modeling procedure is as follows:
\begin{enumerate}
	\item Add a new child \emph{Structural View} to the model object \emph{Aspect}.
	\item Add two new children to the \emph{Structural View} which are both \emph{Class}.
	\item Edit the properties of the first class as: \emph{Abstract -- true} and \emph{Name -- A} (unchanged default properties are not shown here).
	\item Edit the properties of the second class as: \emph{Name -- B} and \emph{Super Types -- A} (unchanged default properties are not shown here).
\end{enumerate}
Note that the inheritance relationship in the UML class diagram is modeled as a property \emph{Super Types} of a class element in base model,
which is in consistence with the TouchRAM metamodel. When you click the \emph{Value} field of the property \emph{Super Types},
a pop-up window is shown to ask for selection of elements as super classes of such a class, see \fig \ref{fig:inheritance}.

The final modeling result of our \emph{base} model is shown in \fig \ref{fig:casestudy1_base_result}.

\subsubsection{Construct a pointcut model.}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.8\textwidth]{figure/simple_casestudy/pc_root}
	\caption{Choose ``Pointcut'' for model object as the ``Root'' of the pointcut model}
	\label{fig:pc_root}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{figure/simple_casestudy/casestudy1_pc_result}
	\caption{Final pointcut model in GeKo interface}
	\label{fig:casestudy1_pc_result}
\end{figure}

The \emph{pointcut} model is used to detect join-points in the \emph{base} model, which are used for further model weaving with corresponding elements
in the \emph{advice} model.
\emph{Note that GeKo uses name-matching to detect join-points.} So it is required to provide each element in the model an identifiable (unique) name.
And the elements in the pointcut model MUST have the same names as those of the corresponding elements in the \emph{base} model.
Otherwise, none join-point would be detected.

When creating a \emph{pointcut} model in the wizard, choose \emph{Pointcut} as the ``Model Object'' instead of the \emph{Aspect} chosen
for the base model, due to the manipulated TouchRAM metamodel auto-generated by GeKo, see \fig \ref{fig:pc_root}.
The topic of \emph{manipulated metamodels} will be discussed later in \sect \ref{sec:manipulated_metamodels}.

In this simple case study, we plan to use class \emph{B} in the \emph{base} model to weave future \emph{advice} model.  
Note that we model class \emph{B} as a child of \emph{StructuralView} because a \emph{classifier} (the super type of \emph{class}) may be contained not only
in \emph{StructuralView} but also in \emph{StateView}. \emph{So, to model the class B as a child of StructuralView is to
indicate the containment relationship without ambiguity.}
The final \emph{pointcut} model is modeled with only one class named \emph{B} under \emph{Structural View}, as shown in \fig \ref{fig:casestudy1_pc_result}.

\subsubsection{Construct an advice model.}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/casestudy1_av}
	\caption{UML class diagram of the advice model}
	\label{fig:casestudy1_av}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.7\textwidth]{figure/simple_casestudy/association}
	\caption{Modeling association}
	\label{fig:association}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.7\textwidth]{figure/simple_casestudy/association_end}
	\caption{Final advice model in GeKo interface}
	\label{fig:association_end}
\end{figure}

Figure \ref{fig:casestudy1_av} shows the UML class diagram of the advice model which we plan to construct.
It is also a simple aspect with only \emph{StructuralView} (class diagram) which contains two classes:
class \emph{C} composes class \emph{D} (the association is named ``\emph{assemble}'' due to the
recommendation of naming each possible element of the model).

When similarly creating an \emph{advice} model via the wizard, due to the manipulated TouchRAM metamodel, you have to 
choose \emph{Advice} as the \emph{Model Object}. 

Then you may construct the \emph{advice} model in a similar way as constructing base model.
In general, GeKo does not ask for a complete model, in accordance with the metamodel, for the advice. Sub/partial model fragment is
enough. But in some cases, you need to provide more information in \emph{advice} model.
For example, in the TouchRAM metamodel, a \emph{classifier}, the super type of \emph{class}, may be contained
in either \emph{StructuralView} or \emph{StateView}. So in the \emph{advice} model, if you are modeling partial
class diagram, \emph{StructuralView} is required for \emph{explicitly indicating the containment} of these classes (classifiers).

Regarding \emph{associations}, as shown in \fig \ref{fig:association}, each association is modeled by association classifier and association ends:
\begin{itemize}
	\item A sibling \emph{Association} classifier for the connected classes.
	\item An \emph{Association End} node as child node for each connected class respectively.
	\item Indicating that the \emph{Association} consists of the two \emph{Association Ends} while each \emph{Association End} belongs
		to such \emph{Association}, see \fig \ref{fig:association} and \fig \ref{fig:association_end}.
	\item Modeling \emph{Reference Type} of the association (regular, composition or aggregation), multiplicity of end properties, and other remaining characteristics
		by setting the values of properties of the \emph{Association Ends}, see \fig \ref{fig:association_end}. Note the multiplicity $*$ is modeled as value $-1$.
\end{itemize}

The final \emph{advice} model is shown in \fig \ref{fig:association_end}.


\subsubsection{Build element mapping from pointcut to advice.}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/mapping_root}
	\caption{Choose ``Mapping'' for model object as the ``Root'' of a mapping model}
	\label{fig:mapping_root}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/mapping_entry}
	\caption{Create mapping entry for the mapping model}
	\label{fig:mapping_entry}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/local_resource}
	\caption{Use ``Local Resource ...'' function to import necessary pointcut and advice models}
	\label{fig:local_resource}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/import_pc_av}
	\caption{Import pointcut and advice models as local resources of the mapping model}
	\label{fig:import_pc_av}
\end{figure}

The final step for modeling is to create a \emph{mapping} model which indicates the mappings from the elements of the \emph{pointcut} model to the corresponding ones
of the \emph{advice} model. Similarly, use the wizard to create a new \emph{Pc2AvMapping} model (Pointcut To Advice Mapping Model) and 
\emph{choose ``Mapping'' as the ``Model Object''}, see \fig \ref{fig:mapping_root}.

In the \emph{Pc2AvMapping} model, the only element you are able to add is \emph{Mapping Entry}, see \fig \ref{fig:mapping_entry}.
Each mapping entry indicates the mapping relationship between a pair of group elements from \emph{pointcut} and \emph{advice} models respectively
by selecting these elements for the \emph{source} and \emph{target} properties of such mapping entry.
\textbf{Note that the \emph{source} is ALWAYS a group of elements from the \emph{pointcut} model while the \emph{target} is ALWAYS a group of elements from the \emph{advice} model,
and they MUST be structurally equal according to the metamodel,} \eg a pair of elements are mapped and both are \emph{Class} (super type \emph{Classifier}).
Because you need to use elements in \emph{pointcut} and \emph{advice} models to edit the \emph{source} and \emph{target} properties of each \emph{mapping entry},
you have to import these two models into your \emph{mapping} model in advance. Right-click any blank space of your \emph{mapping} model in the eclipse editor, and then choose the ``Local Resource ...''
sub-menu in the pop-up window, see \fig \ref{fig:local_resource} (you can also do this in the \emph{Outline} view window of eclipse environment).
Then browse to the location where you save the case study project, and choose both \emph{pointcut} and \emph{advice} models to be imported, see \fig \ref{fig:import_pc_av}.

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.8\textwidth]{figure/simple_casestudy/entry_property}
	\caption{Edit mapping entry property}
	\label{fig:entry_property}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/casestudy1_mp_result}
	\caption{Final mapping model in GeKo interface}
	\label{fig:casestudy1_mp_result}
\end{figure}

When editing the properties of mapping entries, you should choose appropriate elements in a pop-up window. 
If there exists relevant elements in \emph{pointcut} and \emph{advice} models with the same name (or without name), 
it always confuses the users which one comes from which model. We are again terribly sorry for the confusion,
and will improve to provide model information in future GeKo versions.
\emph{Currently the only way to handle this problem is to check the order of the imported resources.}
For instance, if we want to establish a mapping from the \emph{StructuralView} in \emph{pointcut} to the \emph{StructuralView} in \emph{advice}, choose
the second ``Structural View'' element in the pop-up window for \emph{source} property while choose the first one for \emph{target}, 
because in our experiment the \emph{advice} model is listed ahead of \emph{pointcut} model as resources, see \fig \ref{fig:entry_property}.
If you misplaced elements from \emph{pointcut} and \emph{advice} models to inappropriate \emph{source} and \emph{target} properties of a \emph{mapping entry},
the original eclipse environment will report \emph{Null Pointer} exception for \emph{element addition} function when you perform future model weaving.

The final \emph{Pc2AvMapping} model is shown in \fig \ref{fig:casestudy1_mp_result}. We established a mapping from the class \emph{B} under the \emph{StructuralView}
in the \emph{pointcut} model to the class \emph{C} under the \emph{StructuralView} in the \emph{advice} model.

\subsubsection{Model Weaving.}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.6\textwidth]{figure/simple_casestudy/casestudy1_woven}
	\caption{Expected final aspect model after model weaving}
	\label{fig:casestudy1_woven}
\end{figure}

\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.8\textwidth]{figure/simple_casestudy/weaving}
	\caption{Select base, pointcut, advice and mapping models for model weaving by GeKo}
	\label{fig:weaving}
\end{figure}

Up to now, we complete all modeling tasks. According to our defined \emph{base}, \emph{pointcut}, \emph{advice} and \emph{mapping} models, 
we are going to weave the class \emph{C} in the \emph{advice} onto the class \emph{B} in the \emph{base} model. 
Therefore, the expected final woven aspect is illustrated in \fig \ref{fig:casestudy1_woven}:
the original class \emph{B} in the \emph{base} model now is replaced by the class \emph{C} while the inheritance relationship keeps
and the class \emph{D} as well as the \emph{association} are added by default to the \emph{base} model.

To perform the model weaving, select all the \emph{base}, \emph{pointcut}, \emph{advice} and \emph{mapping} models in the eclipse \emph{Project Explorer} window, then right-click them and choose
``Weave (Inferring Completion of Pointcut to Advice Mapping)'' function under the sub-menu ``GeKo Weaver'' in the pop-up window, see \fig \ref{fig:weaving}.
A woven model with the same extension name as that of the \emph{base} model will be generated by GeKo and stored in the same place as where the \emph{base} model is saved.

\begin{figure}[htbp]
	\centering
	\includegraphics[width=\textwidth]{figure/simple_casestudy/casestudy1_woven_result}
	\caption{Final woven model in GeKo interface}
	\label{fig:casestudy1_woven_result}
\end{figure}

The final woven model is shown in \fig \ref{fig:casestudy1_woven_result}. It is in consistence with the expected result. 

We succeed to adopt the metamodel of TouchRAM and perform simple modeling and model weaving functionality of TouchRAM on GeKo without any additional coding at present!



